package net.narusas.aceauction.push.messageapp;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.border.TitledBorder;
import javax.swing.JTextArea;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JScrollPane;
import java.awt.FlowLayout;
import javax.swing.border.EtchedBorder;
import java.awt.Color;
import java.awt.GridLayout;

public class AuctionPushMessageApp extends JFrame {

	private static final long serialVersionUID = -9034683485357575809L;
	private JPanel contentPane;
	JPanel panel;
	JTextArea messageTextArea;
	JButton sendButton;
	JPanel panel_1;
	JPanel panel_2;
	JCheckBox scheduleEnableCheckBox;
	JLabel label;
	JTextField scheduleTextField;
	JPanel panel_3;
	JScrollPane scrollPane;
	JTextArea logTextArea;
	JPanel panel_4;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					AuctionPushMessageApp frame = new AuctionPushMessageApp();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public AuctionPushMessageApp() {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 450, 300);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		contentPane.setLayout(new BorderLayout(0, 0));
		setContentPane(contentPane);
		
		panel_1 = new JPanel();
		panel_1.setBorder(new TitledBorder(null, "\uC2A4\uCF00\uC904 \uC804\uC1A1", TitledBorder.LEADING, TitledBorder.TOP, null, null));
		contentPane.add(panel_1, BorderLayout.CENTER);
		panel_1.setLayout(new BorderLayout(0, 0));
		
		panel_2 = new JPanel();
		FlowLayout flowLayout = (FlowLayout) panel_2.getLayout();
		flowLayout.setAlignment(FlowLayout.LEFT);
		panel_1.add(panel_2, BorderLayout.NORTH);
		
		scheduleEnableCheckBox = new JCheckBox("전송활성화");
		panel_2.add(scheduleEnableCheckBox);
		
		label = new JLabel("주기(분)");
		panel_2.add(label);
		
		scheduleTextField = new JTextField();
		panel_2.add(scheduleTextField);
		scheduleTextField.setColumns(10);
		
		panel_3 = new JPanel();
		panel_1.add(panel_3, BorderLayout.CENTER);
		panel_3.setLayout(new BorderLayout(0, 0));
		
		scrollPane = new JScrollPane();
		panel_3.add(scrollPane, BorderLayout.CENTER);
		
		logTextArea = new JTextArea();
		scrollPane.setViewportView(logTextArea);
		
		panel_4 = new JPanel();
		contentPane.add(panel_4, BorderLayout.NORTH);
		panel_4.setLayout(new GridLayout(1, 0, 0, 0));
		
		panel = new JPanel();
		panel_4.add(panel);
		panel.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null), "\uBA54\uC2DC\uC9C0 \uC804\uC1A1", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0)));
		panel.setLayout(new BorderLayout(0, 0));
		
		messageTextArea = new JTextArea();
		panel.add(messageTextArea);
		
		sendButton = new JButton("전송");
		panel.add(sendButton, BorderLayout.EAST);
	}

	public void setController(Controller controller) {
		// TODO Auto-generated method stub
		
	}

}
